Requests
========

   Here are the requests:

`Root PATHNAME \n'
     Response expected: no.  Tell the server which `CVSROOT' to use.
     Note that PATHNAME is a local directory and *not* a fully
     qualified `CVSROOT' variable.  PATHNAME must already exist; if
     creating a new root, use the `init' request, not `Root'.  PATHNAME
     does not include the hostname of the server, how to access the
     server, etc.; by the time the CVS protocol is in use, connection,
     authentication, etc., are already taken care of.

     The `Root' request must be sent only once, and it must be sent
     before any requests other than `Valid-responses',
     `valid-requests', `UseUnchanged', or `init'.

`Valid-responses REQUEST-LIST \n'
     Response expected: no.  Tell the server what responses the client
     will accept.  request-list is a space separated list of tokens.

`valid-requests \n'
     Response expected: yes.  Ask the server to send back a
     `Valid-requests' response.

`Directory LOCAL-DIRECTORY \n'
     Additional data: REPOSITORY \n.  Response expected: no.  Tell the
     server what directory to use.  The REPOSITORY should be a
     directory name from a previous server response.  Note that this
     both gives a default for `Entry' and `Modified' and also for `ci'
     and the other commands; normal usage is to send `Directory' for
     each directory in which there will be an `Entry' or `Modified',
     and then a final `Directory' for the original directory, then the
     command.  The LOCAL-DIRECTORY is relative to the top level at
     which the command is occurring (i.e. the last `Directory' which is
     sent before the command); to indicate that top level, `.' should
     be sent for LOCAL-DIRECTORY.

     Here is an example of where a client gets REPOSITORY and
     LOCAL-DIRECTORY.  Suppose that there is a module defined by

          moddir 1dir

     That is, one can check out `moddir' and it will take `1dir' in the
     repository and check it out to `moddir' in the working directory.
     Then an initial check out could proceed like this:

          C: Root /home/kingdon/zwork/cvsroot
          . . .
          C: Argument moddir
          C: Directory .
          C: /home/kingdon/zwork/cvsroot
          C: co
          S: Clear-sticky moddir/
          S: /home/kingdon/zwork/cvsroot/1dir/
          . . .
          S: ok

     In this example the response shown is `Clear-sticky', but it could
     be another response instead.  Note that it returns two pathnames.
     The first one, `moddir/', indicates the working directory to check
     out into.  The second one, ending in `1dir/', indicates the
     directory to pass back to the server in a subsequent `Directory'
     request.  For example, a subsequent `update' request might look
     like:

          C: Directory moddir
          C: /home/kingdon/zwork/cvsroot/1dir
          . . .
          C: update

     For a given LOCAL-DIRECTORY, the repository will be the same for
     each of the responses, so one can use the repository from whichever
     response is most convenient.  Typically a client will store the
     repository along with the sources for each LOCAL-DIRECTORY, use
     that same setting whenever operating on that LOCAL-DIRECTORY, and
     not update the setting as long as the LOCAL-DIRECTORY exists.

     A client is free to rename a LOCAL-DIRECTORY at any time (for
     example, in response to an explicit user request).  While it is
     true that the server supplies a LOCAL-DIRECTORY to the client, as
     noted above, this is only the default place to put the directory.
     Of course, the various `Directory' requests for a single command
     (for example, `update' or `ci' request) should name a particular
     directory with the same LOCAL-DIRECTORY.

     Each `Directory' request specifies a brand-new LOCAL-DIRECTORY and
     REPOSITORY; that is, LOCAL-DIRECTORY and REPOSITORY are never
     relative to paths specified in any previous `Directory' request.

`Max-dotdot LEVEL \n'
     Response expected: no.  Tell the server that LEVEL levels of
     directories above the directory which `Directory' requests are
     relative to will be needed.  For example, if the client is
     planning to use a `Directory' request for `../../foo', it must
     send a `Max-dotdot' request with a LEVEL of at least 2.
     `Max-dotdot' must be sent before the first `Directory' request.

`Static-directory \n'
     Response expected: no.  Tell the server that the directory most
     recently specified with `Directory' should not have additional
     files checked out unless explicitly requested.  The client sends
     this if the `Entries.Static' flag is set, which is controlled by
     the `Set-static-directory' and `Clear-static-directory' responses.

`Sticky TAGSPEC \n'
     Response expected: no.  Tell the server that the directory most
     recently specified with `Directory' has a sticky tag or date
     TAGSPEC.  The first character of TAGSPEC is `T' for a tag, or `D'
     for a date.  The remainder of TAGSPEC contains the actual tag or
     date.

     The server should remember `Static-directory' and `Sticky'
     requests for a particular directory; the client need not resend
     them each time it sends a `Directory' request for a given
     directory.  However, the server is not obliged to remember them
     beyond the context of a single command.

`Checkin-prog PROGRAM \n'
     Response expected: no.  Tell the server that the directory most
     recently specified with `Directory' has a checkin program PROGRAM.
     Such a program would have been previously set with the
     `Set-checkin-prog' response.

`Update-prog PROGRAM \n'
     Response expected: no.  Tell the server that the directory most
     recently specified with `Directory' has an update program PROGRAM.
     Such a program would have been previously set with the
     `Set-update-prog' response.

`Entry ENTRY-LINE \n'
     Response expected: no.  Tell the server what version of a file is
     on the local machine.  The name in ENTRY-LINE is a name relative
     to the directory most recently specified with `Directory'.  If the
     user is operating on only some files in a directory, `Entry'
     requests for only those files need be included.  If an `Entry'
     request is sent without `Modified', `Is-modified', or `Unchanged',
     it means the file is lost (does not exist in the working
     directory).  If both `Entry' and one of `Modified', `Is-modified',
     or `Unchanged' are sent for the same file, `Entry' must be sent
     first.  For a given file, one can send `Modified', `Is-modified',
     or `Unchanged', but not more than one of these three.

`Kopt OPTION \n'
     This indicates to the server which keyword expansion options to
     use for the file specified by the next `Modified' or `Is-modified'
     request (for example `-kb' for a binary file).  This is similar to
     `Entry', but is used for a file for which there is no entries line.
     Typically this will be a file being added via an `add' or `import'
     request.  The client may not send both `Kopt' and `Entry' for the
     same file.

`Modified FILENAME \n'
     Response expected: no.  Additional data: mode, \n, file
     transmission.  Send the server a copy of one locally modified
     file.  FILENAME is relative to the most recent repository sent
     with `Directory'.  If the user is operating on only some files in
     a directory, only those files need to be included.  This can also
     be sent without `Entry', if there is no entry for the file.

`Is-modified FILENAME \n'
     Response expected: no.  Additional data: none.  Like `Modified',
     but used if the server only needs to know whether the file is
     modified, not the contents.

     The commands which can take `Is-modified' instead of `Modified'
     with no known change in behavior are: `admin', `diff' (if and only
     if two `-r' or `-D' options are specified), `watch-on',
     `watch-off', `watch-add', `watch-remove', `watchers', `editors',
     `log', and `annotate'.

     For the `status' command, one can send `Is-modified' but if the
     client is using imperfect mechanisms such as timestamps to
     determine whether to consider a file modified, then the behavior
     will be different.  That is, if one sends `Modified', then the
     server will actually compare the contents of the file sent and the
     one it derives from to determine whether the file is genuinely
     modified.  But if one sends `Is-modified', then the server takes
     the client's word for it.  A similar situation exists for `tag',
     if the `-c' option is specified.

     Commands for which `Modified' is necessary are `co', `ci',
     `update', and `import'.

     Commands which do not need to inform the server about a working
     directory, and thus should not be sending either `Modified' or
     `Is-modified': `rdiff', `rtag', `history', `init', and `release'.

     Commands for which further investigation is warranted are:
     `remove', `add', and `export'.  Pending such investigation, the
     more conservative course of action is to stick to `Modified'.

`Unchanged FILENAME \n'
     Response expected: no.  Tell the server that FILENAME has not been
     modified in the checked out directory.  The name is relative to
     the most recent repository sent with `Directory'.

`UseUnchanged \n'
     Response expected: no.  To specify the version of the protocol
     described in this document, servers must support this request
     (although it need not do anything) and clients must issue it.

`Notify FILENAME \n'
     Response expected: no.  Tell the server that a `edit' or `unedit'
     command has taken place.  The server needs to send a `Notified'
     response, but such response is deferred until the next time that
     the server is sending responses.  Response expected: no.
     Additional data:
          NOTIFICATION-TYPE \t TIME \t CLIENTHOST \t
          WORKING-DIR \t WATCHES \n
     where NOTIFICATION-TYPE is `E' for edit, `U' for unedit, undefined
     behavior if `C', and all other letters should be silently ignored
     for future expansion.  TIME is the time at which the edit or
     unedit took place, in a user-readable format of the client's
     choice (the server should treat the time as an opaque string
     rather than interpreting it).  CLIENTHOST is the name of the host
     on which the edit or unedit took place, and WORKING-DIR is the
     pathname of the working directory where the edit or unedit took
     place.  WATCHES are the temporary watches to set.  If WATCHES is
     followed by \t then the \t and the rest of the line should be
     ignored, for future expansion.

     Note that a client may be capable of performing an `edit' or
     `unedit' operation without connecting to the server at that time,
     and instead connecting to the server when it is convenient (for
     example, when a laptop is on the net again) to send the `Notify'
     requests.  Even if a client is capable of deferring notifications,
     it should attempt to send them immediately (one can send `Notify'
     requests together with a `noop' request, for example), unless
     perhaps if it can know that a connection would be impossible.

`Questionable FILENAME \n'
     Response expected: no.  Additional data: no.  Tell the server to
     check whether FILENAME should be ignored, and if not, next time the
     server sends responses, send (in a `M' response) `?' followed by
     the directory and filename.  FILENAME must not contain `/'; it
     needs to be a file in the directory named by the most recent
     `Directory' request.

`Case \n'
     Response expected: no.  Tell the server that filenames should be
     matched in a case-insensitive fashion.  Note that this is not the
     primary mechanism for achieving case-insensitivity; for the most
     part the client keeps track of the case which the server wants to
     use and takes care to always use that case regardless of what the
     user specifies.  For example the filenames given in `Entry' and
     `Modified' requests for the same file must match in case
     regardless of whether the `Case' request is sent.  The latter
     mechanism is more general (it could also be used for 8.3
     filenames, VMS filenames with more than one `.', and any other
     situation in which there is a predictable mapping between
     filenames in the working directory and filenames in the protocol),
     but there are some situations it cannot handle (ignore patterns, or
     situations where the user specifies a filename and the client does
     not know about that file).

`Argument TEXT \n'
     Response expected: no.  Save argument for use in a subsequent
     command.  Arguments accumulate until an argument-using command is
     given, at which point they are forgotten.

`Argumentx TEXT \n'
     Response expected: no.  Append \n followed by text to the current
     argument being saved.

`Global_option OPTION \n'
     Response expected: no.  Transmit one of the global options `-q',
     `-Q', `-l', `-t', `-r', or `-n'.  OPTION must be one of those
     strings, no variations (such as combining of options) are allowed.
     For graceful handling of `valid-requests', it is probably better
     to make new global options separate requests, rather than trying
     to add them to this request.

`Gzip-stream LEVEL \n'
     Response expected: no.  Use zlib (RFC 1950/1951) compression to
     compress all further communication between the client and the
     server.  After this request is sent, all further communication
     must be compressed.  All further data received from the server
     will also be compressed.  The LEVEL argument suggests to the
     server the level of compression that it should apply; it should be
     an integer between 1 and 9, inclusive, where a higher number
     indicates more compression.

`Kerberos-encrypt \n'
     Response expected: no.  Use Kerberos encryption to encrypt all
     further communication between the client and the server.  This
     will only work if the connection was made over Kerberos in the
     first place.  If both the `Gzip-stream' and the `Kerberos-encrypt'
     requests are used, the `Kerberos-encrypt' request should be used
     first.  This will make the client and server encrypt the
     compressed data, as opposed to compressing the encrypted data.
     Encrypted data is generally incompressible.

     Note that this request does not fully prevent an attacker from
     hijacking the connection, in the sense that it does not prevent
     hijacking the connection between the initial authentication and the
     `Kerberos-encrypt' request.

`Gssapi-encrypt \n'
     Response expected: no.  Use GSSAPI encryption to encrypt all
     further communication between the client and the server.  This
     will only work if the connection was made over GSSAPI in the first
     place.  See `Kerberos-encrypt', above, for the relation between
     `Gssapi-encrypt' and `Gzip-stream'.

     Note that this request does not fully prevent an attacker from
     hijacking the connection, in the sense that it does not prevent
     hijacking the connection between the initial authentication and the
     `Gssapi-encrypt' request.

`Gssapi-authenticate \n'
     Response expected: no.  Use GSSAPI authentication to authenticate
     all further communication between the client and the server.  This
     will only work if the connection was made over GSSAPI in the first
     place.  Encrypted data is automatically authenticated, so using
     both `Gssapi-authenticate' and `Gssapi-encrypt' has no effect
     beyond that of `Gssapi-encrypt'.  Unlike encrypted data, it is
     reasonable to compress authenticated data.

     Note that this request does not fully prevent an attacker from
     hijacking the connection, in the sense that it does not prevent
     hijacking the connection between the initial authentication and the
     `Gssapi-authenticate' request.

`Set VARIABLE=VALUE \n'
     Response expected: no.  Set a user variable VARIABLE to VALUE.

`expand-modules \n'
     Response expected: yes.  Expand the modules which are specified in
     the arguments.  Returns the data in `Module-expansion' responses.
     Note that the server can assume that this is checkout or export,
     not rtag or rdiff; the latter do not access the working directory
     and thus have no need to expand modules on the client side.

     Expand may not be the best word for what this request does.  It
     does not necessarily tell you all the files contained in a module,
     for example.  Basically it is a way of telling you which working
     directories the server needs to know about in order to handle a
     checkout of the specified modules.

     For example, suppose that the server has a module defined by

          aliasmodule -a 1dir

     That is, one can check out `aliasmodule' and it will take `1dir'
     in the repository and check it out to `1dir' in the working
     directory.  Now suppose the client already has this module checked
     out and is planning on using the `co' request to update it.
     Without using `expand-modules', the client would have two bad
     choices: it could either send information about *all* working
     directories under the current directory, which could be
     unnecessarily slow, or it could be ignorant of the fact that
     `aliasmodule' stands for `1dir', and neglect to send information
     for `1dir', which would lead to incorrect operation.

     With `expand-modules', the client would first ask for the module to
     be expanded:

          C: Root /home/kingdon/zwork/cvsroot
          . . .
          C: Argument aliasmodule
          C: Directory .
          C: /home/kingdon/zwork/cvsroot
          C: expand-modules
          S: Module-expansion 1dir
          S: ok

     and then it knows to check the `1dir' directory and send requests
     such as `Entry' and `Modified' for the files in that directory.

`ci \n'
`diff \n'
`tag \n'
`status \n'
`log \n'
`admin \n'
`history \n'
`watchers \n'
`editors \n'
`annotate \n'
     Response expected: yes.  Actually do a cvs command.  This uses any
     previous `Argument', `Directory', `Entry', or `Modified' requests,
     if they have been sent.  The last `Directory' sent specifies the
     working directory at the time of the operation.  No provision is
     made for any input from the user.  This means that `ci' must use a
     `-m' argument if it wants to specify a log message.

`co \n'
     Response expected: yes.  Get files from the repository.  This uses
     any previous `Argument', `Directory', `Entry', or `Modified'
     requests, if they have been sent.  Arguments to this command are
     module names; the client cannot know what directories they
     correspond to except by (1) just sending the `co' request, and then
     seeing what directory names the server sends back in its
     responses, and (2) the `expand-modules' request.

`export \n'
     Response expected: yes.  Get files from the repository.  This uses
     any previous `Argument', `Directory', `Entry', or `Modified'
     requests, if they have been sent.  Arguments to this command are
     module names, as described for the `co' request.  The intention
     behind this command is that a client can get sources from a server
     without storing CVS information about those sources.  That is, a
     client probably should not count on being able to take the entries
     line returned in the `Created' response from an `export' request
     and send it in a future `Entry' request.  Note that the entries
     line in the `Created' response must indicate whether the file is
     binary or text, so the client can create it correctly.

`rdiff \n'
`rtag \n'
     Response expected: yes.  Actually do a cvs command.  This uses any
     previous `Argument' requests, if they have been sent.  The client
     should not send `Directory', `Entry', or `Modified' requests for
     this command; they are not used.  Arguments to these commands are
     module names, as described for `co'.

`init ROOT-NAME \n'
     Response expected: yes.  If it doesn't already exist, create a CVS
     repository ROOT-NAME.  Note that ROOT-NAME is a local directory
     and *not* a fully qualified `CVSROOT' variable.  The `Root'
     request need not have been previously sent.

`update \n'
     Response expected: yes.  Actually do a `cvs update' command.  This
     uses any previous `Argument', `Directory', `Entry', or `Modified'
     requests, if they have been sent.  The last `Directory' sent
     specifies the working directory at the time of the operation.  The
     `-I' option is not used-files which the client can decide whether
     to ignore are not mentioned and the client sends the
     `Questionable' request for others.

`import \n'
     Response expected: yes.  Actually do a `cvs import' command.  This
     uses any previous `Argument', `Directory', `Entry', or `Modified'
     requests, if they have been sent.  The last `Directory' sent
     specifies the working directory at the time of the operation.  The
     files to be imported are sent in `Modified' requests (files which
     the client knows should be ignored are not sent; the server must
     still process the CVSROOT/cvsignore file unless -I ! is sent).  A
     log message must have been specified with a `-m' argument.

`add \n'
     Response expected: yes.  Add a file or directory.  This uses any
     previous `Argument', `Directory', `Entry', or `Modified' requests,
     if they have been sent.  The last `Directory' sent specifies the
     working directory at the time of the operation.

     To add a directory, send the directory to be added using
     `Directory' and `Argument' requests.  For example:

          C: Root /u/cvsroot
          . . .
          C: Argument nsdir
          C: Directory nsdir
          C: /u/cvsroot/1dir/nsdir
          C: Directory .
          C: /u/cvsroot/1dir
          C: add
          S: M Directory /u/cvsroot/1dir/nsdir added to the repository
          S: ok

     You will notice that the server does not signal to the client in
     any particular way that the directory has been successfully added.
     The client is supposed to just assume that the directory has been
     added and update its records accordingly.  Note also that adding a
     directory is immediate; it does not wait until a `ci' request as
     files do.

     To add a file, send the file to be added using a `Modified'
     request.  For example:

          C: Argument nfile
          C: Directory .
          C: /u/cvsroot/1dir
          C: Modified nfile
          C: u=rw,g=r,o=r
          C: 6
          C: hello
          C: add
          S: E cvs server: scheduling file `nfile' for addition
          S: Mode u=rw,g=r,o=r
          S: Checked-in ./
          S: /u/cvsroot/1dir/nfile
          S: /nfile/0///
          S: E cvs server: use 'cvs commit' to add this file permanently
          S: ok

     Note that the file has not been added to the repository; the only
     effect of a successful `add' request, for a file, is to supply the
     client with a new entries line containing `0' to indicate an added
     file.  In fact, the client probably could perform this operation
     without contacting the server, although using `add' does cause the
     server to perform a few more checks.

     The client sends a subsequent `ci' to actually add the file to the
     repository.

     Another quirk of the `add' request is that with CVS 1.9 and older,
     a pathname specified in an `Argument' request cannot contain `/'.
     There is no good reason for this restriction, and in fact more
     recent CVS servers don't have it.  But the way to interoperate
     with the older servers is to ensure that all `Directory' requests
     for `add' (except those used to add directories, as described
     above), use `.' for LOCAL-DIRECTORY.  Specifying another string for
     LOCAL-DIRECTORY may not get an error, but it will get you strange
     `Checked-in' responses from the buggy servers.

`remove \n'
     Response expected: yes.  Remove a file.  This uses any previous
     `Argument', `Directory', `Entry', or `Modified' requests, if they
     have been sent.  The last `Directory' sent specifies the working
     directory at the time of the operation.

     Note that this request does not actually do anything to the
     repository; the only effect of a successful `remove' request is to
     supply the client with a new entries line containing `-' to
     indicate a removed file.  In fact, the client probably could
     perform this operation without contacting the server, although
     using `remove' may cause the server to perform a few more checks.

     The client sends a subsequent `ci' request to actually record the
     removal in the repository.

`watch-on \n'
`watch-off \n'
`watch-add \n'
`watch-remove \n'
     Response expected: yes.  Actually do the `cvs watch on', `cvs
     watch off', `cvs watch add', and `cvs watch remove' commands,
     respectively.  This uses any previous `Argument', `Directory',
     `Entry', or `Modified' requests, if they have been sent.  The last
     `Directory' sent specifies the working directory at the time of
     the operation.

`release \n'
     Response expected: yes.  Note that a `cvs release' command has
     taken place and update the history file accordingly.

`noop \n'
     Response expected: yes.  This request is a null command in the
     sense that it doesn't do anything, but merely (as with any other
     requests expecting a response) sends back any responses pertaining
     to pending errors, pending `Notified' responses, etc.

`update-patches \n'
     Response expected: yes.  This request does not actually do
     anything.  It is used as a signal that the server is able to
     generate patches when given an `update' request.  The client must
     issue the `-u' argument to `update' in order to receive patches.

`gzip-file-contents LEVEL \n'
     Response expected: no.  Note that this request does not follow the
     response convention stated above.  `Gzip-stream' is suggested
     instead of `gzip-file-contents' as it gives better compression; the
     only reason to implement the latter is to provide compression with
     CVS 1.8 and earlier.  The `gzip-file-contents' request asks the
     server to compress files it sends to the client using `gzip'
     (RFC1952/1951) compression, using the specified level of
     compression.  If this request is not made, the server must not
     compress files.

     This is only a hint to the server.  It may still decide (for
     example, in the case of very small files, or files that already
     appear to be compressed) not to do the compression.  Compression
     is indicated by a `z' preceding the file length.

     Availability of this request in the server indicates to the client
     that it may compress files sent to the server, regardless of
     whether the client actually uses this request.

`wrapper-sendme-rcsOptions \n'
     Response expected: yes.  Request that the server transmit mappings
     from filenames to keyword expansion modes in `Wrapper-rcsOption'
     responses.

`OTHER-REQUEST TEXT \n'
     Response expected: yes.  Any unrecognized request expects a
     response, and does not contain any additional data.  The response
     will normally be something like `error  unrecognized request', but
     it could be a different error if a previous command which doesn't
     expect a response produced an error.

   When the client is done, it drops the connection.

Introduction to Responses
=========================

   After a command which expects a response, the server sends however
many of the following responses are appropriate.  The server should not
send data at other times (the current implementation may violate this
principle in a few minor places, where the server is printing an error
message and exiting--this should be investigated further).

   Any set of responses always ends with `error' or `ok'.  This
indicates that the response is over.

   The responses `Checked-in', `New-entry', `Updated', `Created',
`Update-existing', `Merged', and `Patched' are refered to as "file
updating" responses, because they change the status of a file in the
working directory in some way.  The responses `Mode', `Mod-time', and
`Checksum' are referred to as "file update modifying" responses because
they modify the next file updating response.  In no case shall a file
update modifying response apply to a file updating response other than
the next one.  Nor can the same file update modifying response occur
twice for a given file updating response (if servers diagnose this
problem, it may aid in detecting the case where clients send an update
modifying response without following it by a file updating response).

The "pathname" in responses
===========================

   Many of the responses contain something called PATHNAME.  The name
is somewhat misleading; it actually indicates a pair of pathnames.
First, a local directory name relative to the directory in which the
command was given (i.e. the last `Directory' before the command).  Then
a linefeed and a repository name.  Then a slash and the filename
(without a `,v' ending).  For example, for a file `i386.mh' which is in
the local directory `gas.clean/config' and for which the repository is
`/rel/cvsfiles/devo/gas/config':

     gas.clean/config/
     /rel/cvsfiles/devo/gas/config/i386.mh

   If the server wants to tell the client to create a directory, then it
merely uses the directory in any response, as described above, and the
client should create the directory if it does not exist.  Note that this
should only be done one directory at a time, in order to permit the
client to correctly store the repository for each directory.  Servers
can use requests such as `Clear-sticky', `Clear-static-directory', or
any other requests, to create directories.

   Some server implementations may poorly distinguish between a
directory which should not exist and a directory which contains no
files; in order to refrain from creating empty directories a client
should both send the `-P' option to `update' or `co', and should also
detect the case in which the server asks to create a directory but not
any files within it (in that case the client should remove the
directory or refrain from creating it in the first place).  Note that
servers could clean this up greatly by only telling the client to
create directories if the directory in question should exist, but until
servers do this, clients will need to offer the `-P' behavior described
above.

Responses
=========

   Here are the responses:

`Valid-requests REQUEST-LIST \n'
     Indicate what requests the server will accept.  REQUEST-LIST is a
     space separated list of tokens.  If the server supports sending
     patches, it will include `update-patches' in this list.  The
     `update-patches' request does not actually do anything.

`Checked-in PATHNAME \n'
     Additional data: New Entries line, \n.  This means a file PATHNAME
     has been successfully operated on (checked in, added, etc.).  name
     in the Entries line is the same as the last component of PATHNAME.

`New-entry PATHNAME \n'
     Additional data: New Entries line, \n.  Like `Checked-in', but the
     file is not up to date.

`Updated PATHNAME \n'
     Additional data: New Entries line, \n, mode, \n, file
     transmission.  A new copy of the file is enclosed.  This is used
     for a new revision of an existing file, or for a new file, or for
     any other case in which the local (client-side) copy of the file
     needs to be updated, and after being updated it will be up to
     date.  If any directory in pathname does not exist, create it.
     This response is not used if `Created' and `Update-existing' are
     supported.

`Created PATHNAME \n'
     This is just like `Updated' and takes the same additional data, but
     is used only if no `Entry', `Modified', or `Unchanged' request has
     been sent for the file in question.  The distinction between
     `Created' and `Update-existing' is so that the client can give an
     error message in several cases: (1) there is a file in the working
     directory, but not one for which `Entry', `Modified', or
     `Unchanged' was sent (for example, a file which was ignored, or a
     file for which `Questionable' was sent), (2) there is a file in
     the working directory whose name differs from the one mentioned in
     `Created' in ways that the client is unable to use to distinguish
     files.  For example, the client is case-insensitive and the names
     differ only in case.

`Update-existing PATHNAME \n'
     This is just like `Updated' and takes the same additional data, but
     is used only if a `Entry', `Modified', or `Unchanged' request has
     been sent for the file in question.

     This response, or `Merged', indicates that the server has
     determined that it is OK to overwrite the previous contents of the
     file specified by PATHNAME.  Provided that the client has correctly
     sent `Modified' or `Is-modified' requests for a modified file, and
     the file was not modified while CVS was running, the server can
     ensure that a user's modifications are not lost.

`Merged PATHNAME \n'
     This is just like `Updated' and takes the same additional data,
     with the one difference that after the new copy of the file is
     enclosed, it will still not be up to date.  Used for the results
     of a merge, with or without conflicts.

     It is useful to preserve an copy of what the file looked like
     before the merge.  This is basically handled by the server; before
     sending `Merged' it will send a `Copy-file' response.  For
     example, if the file is `aa' and it derives from revision 1.3, the
     `Copy-file' response will tell the client to copy `aa' to
     `.#aa.1.3'.  It is up to the client to decide how long to keep this
     file around; traditionally clients have left it around forever,
     thus letting the user clean it up as desired.  But another answer,
     such as until the next commit, might be preferable.

`Rcs-diff PATHNAME \n'
     This is just like `Updated' and takes the same additional data,
     with the one difference that instead of sending a new copy of the
     file, the server sends an RCS change text.  This change text is
     produced by `diff -n' (the GNU diff `-a' option may also be used).
     The client must apply this change text to the existing file.
     This will only be used when the client has an exact copy of an
     earlier revision of a file.  This response is only used if the
     `update' command is given the `-u' argument.

`Patched PATHNAME \n'
     This is just like `Rcs-diff' and takes the same additional data,
     except that it sends a standard patch rather than an RCS change
     text.  The patch is produced by `diff -c' for CVS 1.6 and later
     (see POSIX.2 for a description of this format), or `diff -u' for
     previous versions of CVS; clients are encouraged to accept either
     format.  Like `Rcs-diff', this response is only used if the
     `update' command is given the `-u' argument.

     The `Patched' response is deprecated in favor of the `Rcs-diff'
     response.  However, older clients (CVS 1.9 and earlier) only
     support `Patched'.

`Mode MODE \n'
     This MODE applies to the next file mentioned in `Checked-in'.
     `Mode' is a file update modifying response as described in
     Response intro.

`Mod-time TIME \n'
     Set the modification time of the next file sent to TIME.
     `Mod-time' is a file update modifying response as described in
     Response intro.  The TIME is in the format specified by
     RFC822 as modified by RFC1123.  The server may specify any
     timezone it chooses; clients will want to convert that to their
     own timezone as appropriate.  An example of this format is:

          26 May 1997 13:01:40 -0400

     There is no requirement that the client and server clocks be
     synchronized.  The server just sends its recommendation for a
     timestamp (based on its own clock, presumably), and the client
     should just believe it (this means that the time might be in the
     future, for example).

`Checksum CHECKSUM\n'
     The CHECKSUM applies to the next file sent (that is, `Checksum' is
     a file update modifying response as described in Response intro).
     In the case of `Patched', the checksum applies to the
     file after being patched, not to the patch itself.  The client
     should compute the checksum itself, after receiving the file or
     patch, and signal an error if the checksums do not match.  The
     checksum is the 128 bit MD5 checksum represented as 32 hex digits
     (MD5 is described in RFC1321).  This response is optional, and is
     only used if the client supports it (as judged by the
     `Valid-responses' request).

`Copy-file PATHNAME \n'
     Additional data: NEWNAME \n.  Copy file PATHNAME to NEWNAME in the
     same directory where it already is.  This does not affect
     `CVS/Entries'.

     This can optionally be implemented as a rename instead of a copy.
     The only use for it which currently has been identified is prior
     to a `Merged' response as described under `Merged'.  Clients can
     probably assume that is how it is being used, if they want to worry
     about things like how long to keep the NEWNAME file around.

`Removed PATHNAME \n'
     The file has been removed from the repository (this is the case
     where cvs prints `file foobar.c is no longer pertinent').

`Remove-entry PATHNAME \n'
     The file needs its entry removed from `CVS/Entries', but the file
     itself is already gone (this happens in response to a `ci' request
     which involves committing the removal of a file).

`Set-static-directory PATHNAME \n'
     This instructs the client to set the `Entries.Static' flag, which
     it should then send back to the server in a `Static-directory'
     request whenever the directory is operated on.  PATHNAME ends in a
     slash; its purpose is to specify a directory, not a file within a
     directory.

`Clear-static-directory PATHNAME \n'
     Like `Set-static-directory', but clear, not set, the flag.

`Set-sticky PATHNAME \n'
     Additional data: TAGSPEC \n.  Tell the client to set a sticky tag
     or date, which should be supplied with the `Sticky' request for
     future operations.  PATHNAME ends in a slash; its purpose is to
     specify a directory, not a file within a directory.  The client
     should store TAGSPEC and pass it back to the server as-is, to
     allow for future expansion.  The first character of TAGSPEC is `T'
     for a tag, `D' for a date, or something else for future expansion.
     The remainder of TAGSPEC contains the actual tag or date.

`Clear-sticky PATHNAME \n'
     Clear any sticky tag or date set by `Set-sticky'.

`Template PATHNAME \n'
     Additional data: file transmission (note: compressed file
     transmissions are not supported).  PATHNAME ends in a slash; its
     purpose is to specify a directory, not a file within a directory.
     Tell the client to store the file transmission as the template log
     message, and then use that template in the future when prompting
     the user for a log message.

`Set-checkin-prog DIR \n'
     Additional data: PROG \n.  Tell the client to set a checkin
     program, which should be supplied with the `Checkin-prog' request
     for future operations.

`Set-update-prog DIR \n'
     Additional data: PROG \n.  Tell the client to set an update
     program, which should be supplied with the `Update-prog' request
     for future operations.

`Notified PATHNAME \n'
     Indicate to the client that the notification for PATHNAME has been
     done.  There should be one such response for every `Notify'
     request; if there are several `Notify' requests for a single file,
     the requests should be processed in order; the first `Notified'
     response pertains to the first `Notify' request, etc.

`Module-expansion PATHNAME \n'
     Return a file or directory which is included in a particular
     module.  PATHNAME is relative to cvsroot, unlike most pathnames in
     responses.  PATHNAME should be used to look and see whether some
     or all of the module exists on the client side; it is not
     necessarily suitable for passing as an argument to a `co' request
     (for example, if the modules file contains the `-d' option, it
     will be the directory specified with `-d', not the name of the
     module).

`Wrapper-rcsOption PATTERN -k 'OPTION' \n'
     Transmit to the client a filename pattern which implies a certain
     keyword expansion mode.  The PATTERN is a wildcard pattern (for
     example, `*.exe'.  The OPTION is `b' for binary, and so on.  Note
     that although the syntax happens to resemble the syntax in certain
     CVS configuration files, it is more constrained; there must be
     exactly one space between PATTERN and `-k' and exactly one space
     between `-k' and `'', and no string is permitted in place of `-k'
     (extensions should be done with new responses, not by extending
     this one, for graceful handling of `Valid-responses').

`M TEXT \n'
     A one-line message for the user.

`Mbinary \n'
     Additional data: file transmission (note: compressed file
     transmissions are not supported).  This is like `M', except the
     contents of the file transmission are binary and should be copied
     to standard output without translation to local text file
     conventions.  To transmit a text file to standard output, servers
     should use a series of `M' requests.

`E TEXT \n'
     Same as `M' but send to stderr not stdout.

`F \n'
     Flush stderr.  That is, make it possible for the user to see what
     has been written to stderr (it is up to the implementation to
     decide exactly how far it should go to ensure this).

`MT TAGNAME DATA \n'
     This response provides for tagged text.  It is similar to
     SGML/HTML/XML in that the data is structured and a naive
     application can also make some sense of it without understanding
     the structure.  The syntax is not SGML-like, however, in order to
     fit into the CVS protocol better and (more importantly) to make it
     easier to parse, especially in a language like perl or awk.

     The TAGNAME can have several forms.  If it starts with `a' to `z'
     or `A' to `Z', then it represents tagged text.  If the
     implementation recognizes TAGNAME, then it may interpret DATA in
     some particular fashion.  If the implementation does not recognize
     TAGNAME, then it should simply treat DATA as text to be sent to
     the user (similar to an `M' response).  There are two tags which
     are general purpose.  The `text' tag is similar to an unrecognized
     tag in that it provides text which will ordinarily be sent to the
     user.  The `newline' tag is used without DATA and indicates that a
     newline will ordinarily be sent to the user (there is no provision
     for embedding newlines in the DATA of other tagged text responses).

     If TAGNAME starts with `+' it indicates a start tag and if it
     starts with `-' it indicates an end tag.  The remainder of TAGNAME
     should be the same for matching start and end tags, and tags
     should be nested (for example one could have tags in the following
     order `+bold' `+italic' `text' `-italic' `-bold' but not `+bold'
     `+italic' `text' `-bold' `-italic').  A particular start and end
     tag may be documented to constrain the tagged text responses which
     are valid between them.

     Note that if DATA is present there will always be exactly one
     space between TAGNAME and DATA; if there is more than one space,
     then the spaces beyond the first are part of DATA.

     Here is an example of some tagged text responses.  Note that there
     is a trailing space after `Checking in' and `initial revision:'
     and there are two trailing spaces after `<--'.  Such trailing
     spaces are, of course, part of DATA.

          MT +checking-in
          MT text Checking in
          MT fname gz.tst
          MT text ;
          MT newline
          MT rcsfile /home/kingdon/zwork/cvsroot/foo/gz.tst,v
          MT text   <--
          MT fname gz.tst
          MT newline
          MT text initial revision:
          MT init-rev 1.1
          MT newline
          MT text done
          MT newline
          MT -checking-in

     If the client does not support the `MT' response, the same
     responses might be sent as:

          M Checking in gz.tst;
          M /home/kingdon/zwork/cvsroot/foo/gz.tst,v  <--  gz.tst
          M initial revision: 1.1
          M done

     For a list of specific tags, see Text tags.

`error ERRNO-CODE ` ' TEXT \n'
     The command completed with an error.  ERRNO-CODE is a symbolic
     error code (e.g. `ENOENT'); if the server doesn't support this
     feature, or if it's not appropriate for this particular message,
     it just omits the errno-code (in that case there are two spaces
     after `error').  Text is an error message such as that provided by
     strerror(), or any other message the server wants to use.

`ok \n'
     The command completed successfully.

Tags for the MT tagged text response
====================================

   The `MT' response, as described in Responses, offers a way
for the server to send tagged text to the client.  This section
describes specific tags.  The intention is to update this section as
servers add new tags.

   In the following descriptions, `text' and `newline' tags are
omitted.  Such tags contain information which is intended for users (or
to be discarded), and are subject to change at the whim of the server.
To avoid being vulnerable to such whim, clients should look for the tags
listed here, not `text', `newline', or other tags.

   The following tag means to indicate to the user that a file has been
updated.  It is more or less redundant with the `Created' and
`Update-existing' responses, but we don't try to specify here whether
it occurs in exactly the same circumstances as `Created' and
`Update-existing'.  The NAME is the pathname of the file being updated
relative to the directory in which the command is occurring (that is,
the last `Directory' request which is sent before the command).

     MT +updated
     MT fname NAME
     MT -updated